package edu.hunau.cxb19.oop.class30;

import java.time.LocalDateTime;

/**
 *
 *@author hb
 *
 * 2020-04-14 15:20:59
 */
public class ThreadSleepTest {

	public static void main(String[] args) {
		Thread t1 = new Thread(() -> {
			for (int i = 0; i < 10; i++) {
				System.out.println(Thread.currentThread().getName() +" ]:i=" + i+":"+LocalDateTime.now());
				if(i==3) {
					try {
						//当前的线程休眠2s
						Thread.sleep(2000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}, "my-thread-01");
		t1.start();
	}
}
